package sjd.ahsj.springbootmybatisplusoracle.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import sjd.ahsj.springbootmybatisplusoracle.entity.AnimeRead;
import sjd.ahsj.springbootmybatisplusoracle.mapper.AnimeMapper;
import sjd.ahsj.springbootmybatisplusoracle.mapper.AnimeReadMapper;
import sjd.ahsj.springbootmybatisplusoracle.service.IAnimeReadService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 阅读记录 服务实现类
 * </p>
 *
 * @author zhanghaogao
 * @since 2018-09-19
 */
@Service
public class AnimeReadServiceImpl extends ServiceImpl<AnimeReadMapper, AnimeRead> implements IAnimeReadService {

    @Autowired
    private AnimeMapper animeMapper;

    @Override
    public boolean insert(AnimeRead entity) {
        animeMapper.addRead(entity.getAnimeId());
        return super.insert(entity);
    }
}
